package main

import "fmt"

// son-extends->father-extends->grandfather
func main() {

	var s *Son = &Son{
		Father: Father{
			GrandFather: GrandFather{
				Age:     60,
				RemarkG: "grandfather"},
			Age:     40,
			RemarkF: "father"},
		Age:     10,
		RemarkS: "son",
	}
	fmt.Println(*s) //{{{60 grandfather} 40 father} 10 son}

	var s1 *Son = new(Son)
	(*s1).Age = 11
	(*s1).RemarkS = "son"
	(*s1).Father.Age = 44
	(*s1).Father.RemarkF = "father"
	(*s1).Father.GrandFather.Age = 66
	(*s1).Father.GrandFather.RemarkG = "grandfather"
	fmt.Println(*s1) //{{{66 grandfather} 44 father} 11 son}
}

type GrandFather struct {
	Age     int
	RemarkG string
}

type Father struct {
	GrandFather
	Age     int
	RemarkF string
}

type Son struct {
	Father
	Age     int
	RemarkS string
}
